﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using Shp.Web.Models.Contracts;
using Shp.Web.Models.Domain;
using Shp.Web.Models.ViewModels;
using StructureMap;

namespace Shp.Web.Bootstrap
{
    public static class StructureMapContainerSetup
    {
        public static void Setup()
        {
            IContainer container = new Container(
                x =>
                {
                    // repository injection
                    x.For(typeof(ICustomerRepository)).Use(typeof(CustomerRepository));

                    // model view builder injection
                    x.For<ICustomerListViewModelBuilder>().Use<CustomerListViewModelBuilder>();
                });

            DependencyResolver.SetResolver(new StructureMapDependencyResolver(container));
        }
    }
}